import { BaseViewerOptions } from "bpmn-js/lib/Modeler";
import { Ref } from "vue";
import BpmnModeler from 'bpmn-js/lib/Modeler'
import { AnyAaaaRecord } from "dns";

/**
 * @description: 弹窗对外暴露的方法
 */
export interface BpmnMethods {
  setBpmnProps: (props: Partial<BpmnProps>) => void;
  getBpmnContainer: () => HTMLElement | undefined
}

export interface BpmnViewerMethods extends BpmnMethods {
}

export interface BpmnModelerMethods extends BpmnMethods {
}

export type RegisterFn = (modalMethods: BpmnMethods, uuid?: string) => void;

export interface ReturnMethods extends BpmnMethods {
  initBpmnModeler: () => void
  importXML: (xml: string) => Promise<any>;
  redoBpmn: () => void
  undoBpmn: () => void
  zoomBpmn: (radio: number) => void
  downloadXml: () => void;
  downloadSvg: () => void;
}

export interface ReturnBpmnModelerMethods extends ReturnMethods {
  savaBpmn: () => void;
}

export type UseBpmnModelerReturnType = [RegisterFn, ReturnBpmnModelerMethods];

export interface BpmnProps {
  xmlContent?: string;
  bpmnContainer?: HTMLElement;
}
